window.addEventListener("load",function(){
  let dl=this.document.querySelector(".dl-box"); 
  let twoUl=this.document.querySelector(".two-row-two");
  let gonggao=this.document.querySelector(".gonggao");
  let guanyuwomen=this.document.querySelector(".guanyuwomen");
  for(let i=0;i<dl.children.length;i++){
    dl.children[i].children[0].addEventListener("click",function(){
        for (let n=0;n<twoUl.children.length;n++){
            twoUl.children[n].className="hidden";   
        }
        twoUl.children[i].className="show";
    });
  }
    console.log(location.search)
    let arr=location.search.substr(1).split("=");
  if (arr[0]=="show"&&arr[1]==0){
      for ( let i=0;i<twoUl.children.length;i++){
          twoUl.children[i].className="hidden";
      }
      twoUl.children[0].className="show";
      // location.search="";
      //添加成功
      layer.open(
          {type: 1,
              content:"<h3 style='text-align: center; margin-top: 20% ;'>添加成功</h3>",
              resize:false,
              area: ['300px', '200px'],
              skin: 'layui-layer-molv',
              time:3000,
              anim :2
          })


  }
    //添加失败
    if (arr[0]=="show"&&arr[1]==1){
        for ( let i=0;i<twoUl.children.length;i++){
            twoUl.children[i].className="hidden";
        }
        twoUl.children[0].className="show";

        layer.open(
            {type: 1,
                content:"<h3 style='text-align: center ;margin-top: 20% ;'>添加失败</h3>",
                resize:false,
                area: ['300px', '200px'],
                skin: 'layui-layer-molv',
                time:3000,
                anim :2

            })
        // location.search="";
    }
  gonggao.addEventListener("click",function(){
    for (let n=0;n<twoUl.children.length;n++){
        twoUl.children[n].className="hidden";   
    }
    twoUl.children[2].className="show";
  });
  guanyuwomen.addEventListener("click",function(){
    for (let n=0;n<twoUl.children.length;n++){
        twoUl.children[n].className="hidden";   
    }
    twoUl.children[3].className="show";
});

});